#pragma once

#include <MyFC/Widget.h>
#include <MyFC/Glyph.h>

#include "Types.h"
#include "DLL.h"

namespace My {

class DLL_API DropDown : public Widget {
private:
	HCURSOR				m_hCurHandClick;
	CRect				m_DownRect;
	CRect				m_TextRect;
	My::Glyph			m_Down;
private:
	CRect CalcTextRect(const String & text);
protected:
	virtual My::Size GetItemCount() = 0;
	virtual String GetItem(My::Size) = 0;
	virtual String GetDefaultItem() = 0;
	virtual bool GetCurrent(int &) = 0;
	virtual int SetCurrent(int) = 0;
public:
	DropDown();
	void Drop();
	void Switch();
public:
	virtual void HandlePaint(CDC * pDC, const CRect & r);
	virtual void HandleLeftDown(unsigned int flags, const CPoint & p);
	virtual void HandleLeftDoubleClick(unsigned int flags, const CPoint & p);
	virtual bool HandleCursor(unsigned int flags, const CPoint & p);
	virtual void HandleUpdateUI();
};

} // My